<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>Basic CRUD Application - jQuery EasyUI CRUD Demo</title>
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/color.css">
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/demo/demo.css">
    <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
    <style>
        .menu>li>a {
            text-decoration: none;
            font-size: 18px;
            color: #333;
        }
    </style>
</head>

<body>
    <div style="margin:20px 0;"></div>
    <!-- 整体布局 -->
    <div class="easyui-layout" data-options="fit:true" id="cc">
        <!-- 上面 -->
        <div data-options="region:'north'" style="height:50px">
            <!-- 导航下拉菜单 -->
            <div class="easyui-panel" style="padding:5px;">
                <a href="#" class="easyui-linkbutton" data-options="plain:true">Home</a>
                <a href="#" class="easyui-splitbutton" data-options="menu:'#mm1',iconCls:'icon-edit'">Edit</a>
                <a href="#" class="easyui-splitbutton" data-options="menu:'#mm2',iconCls:'icon-ok'">Ok</a>
                <a href="#" class="easyui-menubutton" data-options="menu:'#mm3',iconCls:'icon-help'">Help</a>
            </div>
            <div id="mm1" style="width:150px;">
                <div data-options="iconCls:'icon-undo'">Undo</div>
                <div data-options="iconCls:'icon-redo'">Redo</div>
                <div class="menu-sep"></div>
                <div>Cut</div>
                <div>Copy</div>
                <div>Paste</div>
                <div class="menu-sep"></div>
                <div>
                    <span>Toolbar</span>
                    <div>
                        <div>Address</div>
                        <div>Link</div>
                        <div>Navigation Toolbar</div>
                        <div>Bookmark Toolbar</div>
                        <div class="menu-sep"></div>
                        <div>New Toolbar...</div>
                    </div>
                </div>
                <div data-options="iconCls:'icon-remove'">Delete</div>
                <div>Select All</div>
            </div>
            <div id="mm2" style="width:100px;">
                <div data-options="iconCls:'icon-ok'">Ok</div>
                <div data-options="iconCls:'icon-cancel'">Cancel</div>
            </div>
            <div id="mm3" style="width:150px;">
                <div>Help</div>
                <div>Update</div>
                <div>
                    <span>About</span>
                    <div class="menu-content" style="padding:10px;text-align:left">
                        <img src="http://www.jeasyui.com/images/logo1.png" style="width:150px;height:50px">
                        <p style="font-size:14px;color:#444">Try jQuery EasyUI to build your modern, interactive,
                            javascript applications.</p>
                    </div>
                </div>
            </div>
        </div>
        <!-- 下面 -->
        <div data-options="region:'south',split:true" style="height:50px;"></div>
        <!-- 右边 -->
        <div data-options="region:'east',split:true" title="East" style="width:100px;"></div>
        <!-- 左边 -->
        <div data-options="region:'west',split:true" title="West" style="width:200px;">
            <!-- 手风琴 -->
            <div class="easyui-accordion" data-options="fit:true">
                <div title="基础模块" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
                    <!-- 选项卡菜单 -->
                    <ul class="menu">
                        <li><a href="javascript:;" data-url="./views/user.html">user</a> </li>
                        <li><a href="javascript:;" data-url="./views/product.html">product</a> </li>
                        <!-- <li><a href="javascript:;" data-url="./views/comment.html">comment</a> </li> -->
                        <li><a href="javascript:;" data-url="./views/classify.html">classify</a> </li>
                        <li><a href="javascript:;" data-url="./views/news.html">news</a> </li>
                    </ul>
                </div>
                <div title="Help" data-options="iconCls:'icon-help'" style="padding:10px;">
                    <p>The accordion allows you to provide multiple panels and display one or more at a time. Each
                        panel has built-in support for expanding and collapsing. Clicking on a panel header to expand
                        or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href'
                        property. Users can define a panel to be selected. If it is not specified, then the first panel
                        is taken by default.</p>
                </div>
                <div title="TreeMenu" data-options="iconCls:'icon-search'" style="padding:10px;">
                    <ul class="easyui-tree">
                        <li>
                            <span>Foods</span>
                            <ul>
                                <li>
                                    <span>Fruits</span>
                                    <ul>
                                        <li>apple</li>
                                        <li>orange</li>
                                    </ul>
                                </li>
                                <li>
                                    <span>Vegetables</span>
                                    <ul>
                                        <li>tomato</li>
                                        <li>carrot</li>
                                        <li>cabbage</li>
                                        <li>potato</li>
                                        <li>lettuce</li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- 中间 -->
        <div data-options="region:'center',title:'Main Title',iconCls:'icon-ok'">
            <table id="dg"></table>
            <div id="tt" class="easyui-tabs" data-options="tools:'#tab-tools',fit:true" style="width:700px;height:250px">
            </div>
        </div>
    </div>
    <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
    <script>
        // 选项卡
        $('.menu>li>a').click(function () {
            var title=$(this).html();
            var url=$(this).data('url');
           addTabs(title,url);
        })

        function addTabs(title,url,id){
            if(id===undefined){
                $.removeCookie('cateId', { path: '/views'}); 
            }
            $('#tt').tabs('add', {
                title: title,
                content: '<iframe frameborder=0 width="100%" height="100%" src="'+url+'"></iframe>',
                closable: true
            });
        }
    </script>
</body>

</html>